package dieci.hibernate;

import dieci.database.PersistentObject;
import dieci.system.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author DuckSys
 */
public class HibSale implements PersistentObject
{

    private long saleId;
    private int clientId;
    private Date saleDate;
    private Set<HibSaleDetails> details = new HashSet();
    private double discount;
    private String discountType;
    private double totalSaleAmount;
    private boolean charged;
    private boolean delivered;
    
    public HibSale()
    {
    }

    public HibSale(Sale sale)
    {
        this.clientId = sale.getClient().getClientId();
        this.saleDate = sale.getSaleDate();
        this.discount = sale.getDiscount();
        this.discountType = sale.getDiscountType();
        this.totalSaleAmount = sale.getTotalSaleAmount();
        this.charged = sale.isCharged();
        this.delivered = sale.isDelivered();
    }

    public HibSale(long saleId, Sale sale)
    {
        this(sale);
        this.saleId = saleId;
    }

    /**
     * Get the value of saleId
     *
     * @return the value of saleId
     */
    public long getSaleId()
    {
        return saleId;
    }

    /**
     * Set the value of saleId
     *
     * @param saleId new value of saleId
     */
    public void setSaleId(long saleId)
    {
        this.saleId = saleId;
    }

        /**
     * Get the value of charged
     *
     * @return the value of charged
     */
    public boolean isCharged()
    {
        return charged;
    }

    /**
     * Set the value of charged
     *
     * @param charged new value of charged
     */
    public void setCharged(boolean charged)
    {
        this.charged = charged;
    }

    
    /**
     * Get the value of totalSaleAmount
     *
     * @return the value of totalSaleAmount
     */
    public double getTotalSaleAmount()
    {
        return totalSaleAmount;
    }

    /**
     * Set the value of totalSaleAmount
     *
     * @param totalSaleAmount new value of totalSaleAmount
     */
    public void setTotalSaleAmount(double totalSaleAmount)
    {
        this.totalSaleAmount = totalSaleAmount;
    }

    /**
     * Get the value of details
     *
     * @return the value of details
     */
    public Set<HibSaleDetails> getDetails()
    {
        return details;
    }

    /**
     * Set the value of details
     *
     * @param details new value of details
     */
    public void setDetails(Set<HibSaleDetails> details)
    {
        this.details = details;
    }
        
    /**
     * Get the value of saleDate
     *
     * @return the value of saleDate
     */
    public Date getSaleDate()
    {
        return saleDate;
    }

    /**
     * Set the value of saleDate
     *
     * @param saleDate new value of saleDate
     */
    public void setSaleDate(Date saleDate)
    {
        this.saleDate = saleDate;
    }

    /**
     * Get the value of discount
     *
     * @return the value of discount
     */
    public double getDiscount()
    {
        return discount;
    }

    /**
     * Set the value of discount
     *
     * @param discount new value of discount
     */
    public void setDiscount(double discount)
    {
        this.discount = discount;
    }

    public boolean isDelivered()
    {
        return delivered;
    }

    public void setDelivered(boolean delivered)
    {
        this.delivered = delivered;
    }

    public String getDiscountType()
    {
        return discountType;
    }

    public void setDiscountType(String discountType)
    {
        this.discountType = discountType;
    }

    public int getClientId()
    {
        return clientId;
    }

    public void setClientId(int clientId)
    {
        this.clientId = clientId;
    }
    
    
}
